<?php

include_once "ConexionBD.php";
include_once "../negocio/Funcionario.php";

class FuncionarioSql{
	
	private $sql;
	
	public function FuncionarioSql() { $this->sql = ConexionBD::getInstancia();}
	
	public function selectFuncionario(&$obj){
		$query = "select * from funcionario where rut like '".$obj->getRut()."'
					 and password like '".$obj->getPassword()."' ";
		$stmt = pg_query($this->sql->getConexion() , $query );
		
		
                pg_execute($stmt , PG_DEFAULT);
		
		pg_fetch($stmt);
		
		$obj->setRut( pg_result($stmt, "RUT") );			 
		//$obj->setNombres ( oci_result($stmt, "NOMBRES") );
		$obj->setPassword (pg_result($stmt, "PASSWORD") );
	}
        public function buscarNombre(&$obj){
            
             $sql="select * from persona where rut='".$obj->getRut()."'";
             //echo $sql;
             $resultado = $this->sql->ejecutarSql($sql);
       
             return $resultado;
        }
}

?>